<?php
if (!defined("LEVEL") || LEVEL < 30 || !defined("OK")) { die('Uždrausta'); }
?>
<script language="JavaScript">
// Notice: The simple theme does not use all options some of them are limited to the advanced theme
tinyMCE.init({
	mode : "textareas",
	elements : "Apie,Maintenance",
	theme : "simple",
	mode : "exact"
	//content_css : "stilius/stilius.css",
	//apply_source_formatting : true,
});

</script>
<?php
if (isset($_POST) && !empty($_POST) && isset($_POST['Konfiguracija'])) {
	$q = "UPDATE `".LENTELES_PRIESAGA."nustatymai` SET
	`Apie` = ".escape($_POST['Apie']).",
	`Keywords` = ".escape($_POST['Keywords']).",
	`Pavadinimas` = ".escape($_POST['Pavadinimas']).",
	`Render` = ".escape($_POST['Render']).",
	`Copyright` = ".escape($_POST['Copyright']).",
	`Pastas` = ".escape($_POST['Pastas']).",
	`Registracija` = ".escape($_POST['Registracija']).",
	`Palaikymas` = ".escape($_POST['Palaikymas']).",
	`Chat_limit` = ".escape($_POST['Chat_limit']).",
	`News_limit` = ".escape($_POST['News_limit']).",
	`Stilius` = ".escape($_POST['Stilius']).",
	`Maintenance` = ".escape($_POST['Maintenance'])." LIMIT 1 ;";
	mysql_query1($q) or die (mysql_error());
	redirect('?id,46;a,1');
}

$stiliai = getDirs('stiliai/');
$nustatymai = array(
	"Form"=>array("action"=>"","method"=>"post","enctype"=>"","id"=>"","class"=>"","name"=>"reg"),
	"Svetainės pavadinimas:"=>array("type"=>"text","value"=>input($conf['Pavadinimas']),"name"=>"Pavadinimas","style"=>"width:100%"),
	"Trumpai apie svetainę:"=>array("type"=>"textarea","id"=>"Apie","value"=>input($conf['Apie']),"name"=>"Apie","class"=>"input","rows"=>"8","style"=>"width:100%"),
	"Raktiniai žodžiai: (skirkite žodžius kableliais)"=>array("type"=>"textarea","value"=>input($conf['Keywords']),"name"=>"Keywords","rows"=>"3","class"=>"input","style"=>"width:100%"),
	"Ar rodyti sugeneravimo laiką:"=>array("type"=>"select","value"=>array("1"=>"Taip","0"=>"Ne"),"selected"=>input($conf['Render']),"name"=>"Render"),
	"Copyright Tekstas:"=>array("type"=>"text","value"=>input($conf['Copyright']),"name"=>"Copyright","style"=>"width:100%"),
	"Svetaines e-paštas:"=>array("type"=>"text","value"=>input($conf['Pastas']),"name"=>"Pastas","style"=>"width:100%"),
	"Leisti registruotis:"=>array("type"=>"select","value"=>array("1"=>"Taip","0"=>"Ne"),"selected"=>input($conf['Registracija']),"name"=>"Registracija"),
	"Svetaine remontuojama?:"=>array("type"=>"select","value"=>array("1"=>"Taip","0"=>"Ne"),"selected"=>input($conf['Palaikymas']),"name"=>"Palaikymas"),
	"Uždarytos svetaines tekstas:"=>array("type"=>"textarea","id"=>"Maintenance","value"=>input($conf['Maintenance']),"name"=>"Maintenance","rows"=>"8","class"=>"input","style"=>"width:100%"),
	"Kiek rodyti ChatBox pranešimu?:"=>array("type"=>"select","value"=>array("5"=>"5","10"=>"10","15"=>"15","20"=>"20","25"=>"25","30"=>"30","35"=>"35","40"=>"40"),"selected"=>input($conf['Chat_limit']),"name"=>"Chat_limit"),
	"Kiek rodyti naujienu?:"=>array("type"=>"select","value"=>array("5"=>"5","10"=>"10","15"=>"15","20"=>"20","25"=>"25","30"=>"30","35"=>"35","40"=>"40"),"selected"=>input($conf['News_limit']),"name"=>"News_limit"),
	"Svetainės stilius:"=>array("type"=>"select","value"=>$stiliai,"selected"=>input($conf['Stilius']),"name"=>"Stilius"),
	""=>array("type"=>"submit","name"=>"Konfiguracija","value"=>"Saugoti")
);

include_once("priedai/class.php");
$bla = new forma();
lentele('Svetainės nustatymai',$bla->form($nustatymai));
?>